﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AppManage.Data.Permissions;

namespace AppManage.EntityFramework.Mapping
{
    public class PermissionMap:EntityTypeConfiguration<Permission>
    {
        public PermissionMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            // Table & Column Mappings
            this.ToTable("Permissions");
            this.Property(t => t.Id).HasColumnName("PermissionId");
            this.Property(t => t.MemberId).HasColumnName("MemberId");
            this.Property(t => t.MemberType).HasColumnName("MemberTypeId");
            this.Property(t => t.ResourceId).HasColumnName("ResourceId");
            this.Property(t => t.ResourceType).HasColumnName("ResourceTypeId");
            this.Property(t => t.AccessType).HasColumnName("AccessTypeId");
            this.Property(t => t.CreatedBy).HasColumnName("CreatedBy");
            this.Property(t => t.CreatedOn).HasColumnName("CreatedOn");
            this.Property(t => t.ModifiedBy).HasColumnName("ModifiedBy");
            this.Property(t => t.ModifiedOn).HasColumnName("ModifiedOn");
        }
    }
}
